<?php
/*
<Model Information> 
Author: Naseer Ahmad
Date: 14-07-2011
Last Updated on:
Last Updated by:
*/


class accountHeadsModel extends appModel
{
	var $name = 'accountHeadsModel';
	
		function addAccountHeads($accountName, 
								$accountType, 
								$firstName, 
								$lastName,
								$fullAddress,
								$city, 
								$phoneNumber, 
								$email)
		{
			$fv = array('accountName'	=>	$accountName,
						'accountType'	=>	$accountType,
						'firstName'		=>	$firstName,
						'lastName'		=>	$lastName,
						'fullAddress'	=>	$fullAddress,
						'city'			=>	$city,
						'phoneNumber'	=>	$phoneNumber,
						'email'			=>	$email,
						'accountStatus'	=>	'Active',
						'userName'		=>	$_COOKIE['userNickName_finsol'],
						'entryDate'		=>	'NOW()');
						
			if($this -> _insertTable('acountHeads', $fv))
				return true;
			else
				return false;
		}

		function updateAccountHeads($id,
								$accountName, 
								$accountType, 
								$firstName, 
								$lastName,
								$fullAddress,
								$city, 
								$phoneNumber, 
								$email)
		{
			$fv = array('accountName'	=>	$accountName,
						'accountType'	=>	$accountType,
						'firstName'		=>	$firstName,
						'lastName'		=>	$lastName,
						'fullAddress'	=>	$fullAddress,
						'city'			=>	$city,
						'phoneNumber'	=>	$phoneNumber,
						'email'			=>	$email,
						'userName'		=>	$_COOKIE['userNickName_finsol']);
						
			$where=array("accountID"	=> $id);
			if($this -> _updateTable('acountHeads', $fv, $where))
				return true;
			else
				return false;
		}
						
	
}

?>